package com.bear.myplatform;

import com.bear.myplatform.balance.Balance;
import com.bear.myplatform.userInfo.UserInfo;
import com.example.myplatform.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class MainActivity extends Activity {
	ListView mainMenu;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		mainMenu =(ListView)findViewById(R.id.mainlist);
		mainMenu.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				Intent intent = null;
				switch((int)id)
				{
				case 0:
					intent = new Intent(MainActivity.this,UserInfo.class);
					intent.putExtra("action", "userInfo.html");
					startActivity(intent);
					break;
				case 1:
					intent = new Intent(MainActivity.this,UserInfo.class);
					intent.putExtra("action", "userInfo.html");
					startActivity(intent);
					break;
				case 2:
					intent = new Intent(MainActivity.this,Balance.class);
					intent.putExtra("action", "balance/moneylist.html");
					startActivity(intent);
					break;
				case 3:
					intent = new Intent(MainActivity.this,UserInfo.class);
					intent.putExtra("action", "userInfo.html");
					startActivity(intent);
					break;
				case 4:
					intent = new Intent(MainActivity.this,UserInfo.class);
					intent.putExtra("action", "userInfo.html");
					startActivity(intent);
					break;
				case 5:
					intent = new Intent(MainActivity.this,UserInfo.class);
					intent.putExtra("action", "userInfo.html");
					startActivity(intent);
					break;
				}
				
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
